//
//  AppDelegate.m
//  01-HomeWork
//
//  Created by dllo on 16/7/14.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "AppDelegate.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[UINavigationBar appearance] setBarTintColor:[UIColor whiteColor]];
    // Override point for customization after application launch.
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    _window.backgroundColor = [UIColor whiteColor];
    [_window makeKeyAndVisible];
    _window.rootViewController = [[UIViewController alloc] init];
//    背景图片
    UIImageView *backGroundImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, _window.frame.size.width, _window.frame.size.height)];
    backGroundImageView.image = [UIImage imageNamed:@"welcome_2"];
    [_window addSubview:backGroundImageView];
    
//  Logo
    UIImageView *logoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(90, 70, 180, 220)];
    logoImageView.image = [UIImage imageNamed:@"logo_lagou"];
    [_window addSubview:logoImageView];
   
//    用户名，密码
    UILabel *userLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 300, 50, 50)];
    userLabel.backgroundColor = [UIColor blackColor];
    userLabel.alpha = 0.6f;
    [_window addSubview:userLabel];
    UIImageView *userImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 300, 40, 40)];
    userImageView.image = [UIImage imageNamed:@"icon_username"];
    [_window addSubview:userImageView];
    userImageView.center = userLabel.center;
    UITextField *userTextField = [[UITextField alloc] initWithFrame:CGRectMake(60, 300, 300, 50)];
    userTextField.backgroundColor = [UIColor blackColor];
    userTextField.placeholder = @"输入手机号／邮箱地址";
    userTextField.alpha = 0.5f;
    [_window addSubview:userTextField];
    
    UILabel *passwordLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 360, 50, 50)];
    passwordLabel.backgroundColor = [UIColor blackColor];
    passwordLabel.alpha = 0.6f;
    [_window addSubview:passwordLabel];
    UIImageView *passwordImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 360, 40, 40)];
    passwordImageView.image = [UIImage imageNamed:@"icon_password"];
    [_window addSubview:passwordImageView];
    passwordImageView.center = passwordLabel.center;
    UITextField *passwordTextField = [[UITextField alloc] initWithFrame:CGRectMake(60, 360, 300,50 )];
    passwordTextField.backgroundColor = [UIColor blackColor];
    passwordTextField.alpha = 0.5f;
    passwordTextField.placeholder = @"输入密码";
    [_window addSubview:passwordTextField];
    
//    登录按钮
    UIButton *loginButton = [UIButton buttonWithType: UIButtonTypeRoundedRect];
    loginButton.frame = CGRectMake(10, 420, _window.frame.size.width - 20, 40);
    loginButton.layer.cornerRadius = 4;
    [loginButton setTitle:@"登录" forState:UIControlStateNormal];
    [loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    loginButton.backgroundColor = [UIColor colorWithRed:0.00 green:0.68 blue:0.53 alpha:1.00];
    
    [_window addSubview:loginButton];
    
//    忘记密码
    UIButton *forgotPasswordBtn = [[UIButton alloc] initWithFrame:CGRectMake(10, 470, 100, 50)];
//    forgotPasswordBtn.backgroundColor = [UIColor redColor];
    [forgotPasswordBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
   
    [forgotPasswordBtn setTitle:@"忘记密码" forState:UIControlStateNormal];
    [_window addSubview:forgotPasswordBtn];
//    现在注册拉钩
    UILabel *registLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 520, _window.frame.size.width, 40)];
//    CGPoint point = registLabel.center;
//    point.x = _window.frame.origin.x / 2;
//    registLabel.center = point;
    registLabel.text = @"现在注册拉钩";
    registLabel.font = [UIFont systemFontOfSize:30];
    registLabel.textColor = [UIColor colorWithRed:0.00 green:0.68 blue:0.53 alpha:1.00];
    [_window addSubview:registLabel];
//    or
    UILabel *orLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 570, _window.frame.size.width, 20)];
    orLabel.text = @"——————————  or  ——————————";
    orLabel.font = [UIFont systemFontOfSize:17];
    orLabel.textColor = [UIColor whiteColor];
    [_window addSubview:orLabel];
//    随便逛逛
    UILabel *casualLabel = [[UILabel alloc] initWithFrame:CGRectMake(150, 600, _window.frame.size.width, 50)];
    casualLabel.text = @"随便逛逛>";
    casualLabel.font = [UIFont systemFontOfSize:20];
    casualLabel.textColor = [UIColor whiteColor];
    [_window addSubview:casualLabel];
     return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
